package github.sf.fw.tools.var;

public class VariableDefine {
    /**
     * 变量名
     */
    protected String variableName;

    /**
     * 属性名
     */
    protected String propertyName;
    /**
     * 变量类型
     */
    protected VarType type;

    public VariableDefine(String variableName, String propertyName, VarType type) {
        this.variableName = variableName;
        this.propertyName = propertyName;
        this.type = type;
    }

    public VariableDefine() {
    }

    public String getVariableName() {
        return variableName;
    }

    public void setVariableName(String variableName) {
        this.variableName = variableName;
    }

    public VarType getType() {
        return type;
    }

    public void setType(VarType type) {
        this.type = type;
    }

    public String getPropertyName() {
        return propertyName;
    }

    public void setPropertyName(String propertyName) {
        this.propertyName = propertyName;
    }

    public Variable toVariable(String val) {
        Variable variable = new Variable();
        variable.setVariableName(variableName);
        variable.setPropertyName(propertyName);
        variable.setType(type);
        variable.setVal(val);
        return variable;
    }
}
